package com.segersten.othello.service.akka.game;


import com.segersten.othello.model.Color;
import com.segersten.othello.model.Point;

public class Action {
	private Point point;
	private Color color;

	public Action() {
	}
	
	public Action(Point point, Color color) {
		this.point = point;
		this.color = color;
	}

	public Point getPoint() {
		return point;
	}

	public Color getColor() {
		return color;
	}

	public void setPoint(Point point) {
		this.point = point;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	@Override
    public String toString()
    {
        return "Action [point=" + point + ", color=" + color + "]";
    }

    @Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((color == null) ? 0 : color.hashCode());
		result = prime * result + ((point == null) ? 0 : point.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Action other = (Action) obj;
		if (color != other.color)
			return false;
		if (point == null) {
			if (other.point != null)
				return false;
		} else if (!point.equals(other.point))
			return false;
		return true;
	}

}
